/* Copyright (c) 2021, National University of Defense Technology. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef PAR_LOBPCG_EIGENSOLVER_H
#define PAR_LOBPCG_EIGENSOLVER_H

#include "par_eigensolver.h"

namespace YHAMG
{

class Par_LOBPCG_EigenSolver : public Par_EigenSolver
{
private:
	const Par_Operator* A;
	const Par_Operator* B;
	const Par_Operator* T;
	const Par_MultiVector* Y;
	
public:
	int    MaxIters;
	double Tolerance;
	int    PrintStats;

	Par_LOBPCG_EigenSolver(const Par_Operator& A);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, const Par_MultiVector& Y);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, const Par_Operator& T);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, const Par_Operator& T, const Par_MultiVector& Y);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, const Par_Operator& B, const Par_Operator& T);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, const Par_Operator& B, const Par_Operator& T, const Par_MultiVector& Y);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, int max_Iters, double tolerance, int print_stats);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, const Par_MultiVector& Y, int max_Iters, double tolerance, int print_stats);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, const Par_Operator& T, int max_Iters, double tolerance, int print_stats);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, const Par_Operator& T, const Par_MultiVector& Y, int max_Iters, double tolerance, int print_stats);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, const Par_Operator& B, const Par_Operator& T, int max_Iters, double tolerance, int print_stats);
	Par_LOBPCG_EigenSolver(const Par_Operator& A, const Par_Operator& B, const Par_Operator& T, const Par_MultiVector& Y, int max_Iters, double tolerance, int print_stats);
	void operator()(const Par_MultiVector& X, const Vector& lamdba, int& iter, const Vector& res) const;
};

}

#endif